package com.xuecheng.content.controller;

import com.xuecheng.api.content.CourseAuditApi;
import com.xuecheng.api.content.model.dto.CourseBaseDTO;
import com.xuecheng.api.content.model.vo.CourseAuditVO;
import com.xuecheng.content.convert.CourseBaseConvert;
import com.xuecheng.content.service.CourseBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CourseAuditController implements CourseAuditApi {

    @Autowired
    private CourseBaseService courseBaseService;

    @PostMapping("m/courseReview/approve")
    public void approveCourse(@RequestBody CourseAuditVO auditVO) {

        CourseBaseDTO dto = new CourseBaseDTO();

        dto.setCourseBaseId(auditVO.getCourseBaseId());
        dto.setAuditStatus(auditVO.getAuditStatus());
        dto.setAuditMind(auditVO.getAuditMind());

        //调用service方法进行课程审核
        courseBaseService.approveCourse(dto);
    }

}